package com.ssh.template;

import javax.servlet.ServletContext;

import org.apache.struts2.views.freemarker.FreemarkerManager;

import com.ssh.template.method.MapAdd;
import com.ssh.template.method.MapRemove;

import freemarker.template.Configuration;
import freemarker.template.TemplateException;

public class ExtendedFreemarkerManager extends FreemarkerManager {
		@Override
		protected Configuration createConfiguration(ServletContext servletContext)
			throws TemplateException {
			Configuration configuration = super.createConfiguration(servletContext);
			//移除map中的某个键值
			configuration.setSharedVariable("mapRemove", new MapRemove() );
			configuration.setSharedVariable("mapAdd", new MapAdd() );
			return configuration;
		}
}
